
<tr>
    <td bgcolor="#e4e4e4">短链接</td>
    <td bgcolor="#e4e4e4">信息页</td>
    <td bgcolor="#e4e4e4">原链接地址</td>
    <td bgcolor="#e4e4e4">操作</td>
</tr>
<script type="text/javascript">
    var is_new  = 0;
</script>
<?php if (is_array($rs)): ?>
<script type="text/javascript" src="<?php echo $this->root;?>/theme/default/u22/js/ZeroClipboard.js" charset="UTF-8"></script>

<?php foreach ($rs as $key => $value): ?>
        <tr id="act_1_<?php echo $key; ?>">
            <td>u22短连接：<input id="copy_<?php echo $value->getUhash();?>" value="http://u22.cc/<?php echo $value->getUhash(); ?>" type="hidden">u22.cc/<?php echo $value->getUhash(); ?><span class="copy red" id="copy_button_<?php echo $value->getUhash();?>">复制</span></td>
            <td><a href="http://u22.cc/<?php echo $value->getUhash(); ?>+"><?php echo $value->getUhash(); ?>+</a></td>
            <td>
            <?php $len  = strlen($value->getUrl()); if($len > 40){echo substr($value->getUrl(), 0,40).'...'; }else{ echo $value->getUrl();; }?>
            </td>
            <td><span class="more"><a href="javascript:showHideTr(<?php echo $key; ?>);">更多&nbsp;<img src="<?php echo $this->webroot . '/theme/default/u22/images'; ?>/more.gif" /></a></span></td>
        </tr>
        
        <tr id="act_2_<?php echo $key; ?>" class="hidden_s">
            <td colspan="4" id="u22_more_<?php echo $value->getUhash();?>">
                <?php
                $tencent_url    = $value->getTencentUrl();
                if(empty($tencent_url)):?>
                <span id="tencent_<?php echo $value->getUhash(); ?>">腾讯短连接:<a href="javascript:tencentUrl('<?php echo $value->getUhash();?>')">生成</a></span>
                <?php else: ?>
                <span id="tencent_<?php echo $value->getUhash(); ?>">腾讯短连接:<input type="hidden" id="qq_copy_<?php echo $value->getUhash(); ?>" value="http://url.cn/<?php echo $tencent_url; ?>">url.cn/<?php echo $tencent_url; ?><span id="qq_copy_button_<?php echo $value->getUhash(); ?>" class="copy">复制</span></span>
                <?php endif;?>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <?php
                $tencent_url    = $value->getSinaUrl();
                if(empty($tencent_url)):?>
                <span id="sina_<?php echo $value->getUhash(); ?>">新浪短连接:<a href="javascript:sinaUrl('<?php echo $value->getUhash();?>')">生成</a></span>
                <?php else: ?>
                <span id="sina_<?php echo $value->getUhash(); ?>">新浪短连接:<input type="hidden" id="sina_copy_<?php echo $value->getUhash(); ?>" value="http://t.cn/<?php echo $tencent_url; ?>">t.cn/<?php echo $tencent_url; ?><span id="sina_copy_button_<?php echo $value->getUhash(); ?>" class="copy">复制</span></span>
                <?php endif;?>

            </td>
        </tr>
        <script>
            clip_sina = new ZeroClipboard.Client();
            clip_sina.setHandCursor( true );
            clip_sina.glue('copy_button_<?php echo $value->getUhash();?>');
            clip_sina.setText( $('#copy_<?php echo $value->getUhash();?>').val());
            //clip_sina   = null;
            clip_sina.addEventListener( "complete", function(){
                alert("复制成功！");
            });

            <?php
                $tencent_url = $value->getTencentUrl();
                if(!empty($tencent_url)):
            ?>
            clip_sina = new ZeroClipboard.Client();
            clip_sina.setHandCursor( true );
            clip_sina.glue('qq_copy_button_<?php echo $value->getUhash();?>');
            clip_sina.setText( $('#qq_copy_<?php echo $value->getUhash();?>').val());
            //clip_sina   = null;
            clip_sina.addEventListener( "complete", function(){
                alert("复制成功！");
            });
            <?php endif;?>

            //复制新浪短连接
            <?php
                $tencent_url = $value->getSinaUrl();
                if(!empty($tencent_url)):
            ?>
                clip_sina = new ZeroClipboard.Client();
                clip_sina.setHandCursor( true );
                clip_sina.glue('sina_copy_button_<?php echo $value->getUhash();?>');
                clip_sina.setText( $('#sina_copy_<?php echo $value->getUhash();?>').val());
                //clip_sina   = null;
                clip_sina.addEventListener( "complete", function(){
                    alert("复制成功！");
                });
            <?php endif;?>
                is_new  = 1;
        </script>
<?php endforeach; ?>
<script>
    if(is_new ==1 ){
        $(".hidden_s").hide();
    }
</script>
<?php endif; ?>